<!DOCTYPE HTML>
<html>
<head>
    <title>店铺审核管理</title>
    <link rel="stylesheet" href="/stylesheets/style.css">
    <script src="/scripts/jquery.min.js"></script>
    <script src="/scripts/boot.js" type="text/javascript"></script>
    <link rel="stylesheet" href="/scripts/miniui/themes/default/miniui.css">
    <link rel="stylesheet" href="/scripts/miniui/themes/icons.css">
    <link rel="stylesheet" href="/scripts/miniui/themes/bootstrap/skin.css">
    <link rel="stylesheet" href="/editor/common.css">
    <script src="/scripts/miniui/miniui.js"></script>
</head>
<body  style="padding: 0;width: 100%;height: 97%">
<div style="width:99%;height: 97%;">
    <div id="outImg">
        <img id="imgId" src="" alt="" onclick="smallImg()">
    </div>
    <div style="padding: 5px">
        <span>保存人ID：</span><input class="mini-textbox" type="text" id="saveUserOId"/>
        <span>保存人昵称：</span><input  class="mini-textbox" type="text" id="saveUserName"/>
        <span>删除人ID：</span><input class="mini-textbox" type="text" id="delUserOId"/>
        <span>删除人昵称：</span><input class="mini-textbox" type="text" id="delUserName"/>
        <a class="mini-button" iconCls="icon-search" onclick="search()">查找</a>
    </div>

    <div id="datagrid1" class="mini-datagrid" style="width:99%;height: 97%;"
         url="/getdata/userMergeManger" idField="id" allowResize="true" onselectionchanged="onSelectionChanged"
         sizeList="[20,30,50,100]" pageSize="20">
        <div property="columns">
            <div type="checkcolumn" width="20" ></div>
            <div field="saveUserOId" width="90" align="center" headerAlign="center">保存用户ID</div>
            <div field="saveUserName" width="90" align="center" headerAlign="center">保存用户昵称</div>
            <div field="saveUserAvatar"  width="30" align="center" headerAlign="center">保存用户头像</div>
            <div field="delUserOId" width="90" align="center" headerAlign="center">删除用户ID</div>
            <div field="delUserName" width="90" align="center" headerAlign="center">删除用户昵称</div>
            <div field="delUserAvatar"  width="30" align="center" headerAlign="center">删除用户头像</div>
            <div field="createdAt" width="60"  align="center" headerAlign="center">创建日期</div>
            <div field="updatedAt" width="60"  align="center" headerAlign="center">更新日期</div>
        </div>
    </div>
</div>
</body>
<script type="text/javascript">
    mini.parse();
    var grid = mini.get("datagrid1");
    grid.load({shopStatus:'3'});
    grid.on("drawcell", function (e) {
        var value = e.value;
        var column = e.column;
        if (column.field == "delUserAvatar") {
            if(value) {
                e.cellHtml = '<img class="bigImg" onclick="bigImgCode()" src="' + value + '?imageMogr2/thumbnail/640x/format/jpg/interlace/1/auto-orient" width="30" height="30" alt="图片">';
            }else{
                e.cellHtml = '<img class="bigImg" onclick="bigImgCode()"  src="http://7xiuo5.com1.z0.glb.clouddn.com/fgImage.png?imageMogr2/auto-orient/thumbnail/!100x100r/gravity/Center/crop/100x100/quality/80/auto-orient" width="30" height="30" alt="图片">';
            }
        }
        if (column.field == "saveUserAvatar") {
            if(value) {
                e.cellHtml = '<img class="bigImg" onclick="bigImg()" src="' + value + '?imageMogr2/thumbnail/640x/format/jpg/interlace/1/auto-orient" width="30" height="30" alt="图片">';
            }else{
                e.cellHtml = '<img class="bigImg" onclick="bigImg()"  src="http://7xiuo5.com1.z0.glb.clouddn.com/fgImage.png?imageMogr2/auto-orient/thumbnail/!100x100r/gravity/Center/crop/100x100/quality/80/auto-orient" width="30" height="30" alt="图片">';
            }
        }
    });
    function search() {
        var saveUserOId = mini.get("saveUserOId").getValue();
        var saveUserName = mini.get("saveUserName").getValue();
        var delUserOId = mini.get("delUserOId").getValue();
        var delUserName = mini.get("delUserName").getValue();
        grid.load({
            saveUserOId: saveUserOId,
            saveUserName:saveUserName,
            delUserOId:delUserOId,
            delUserName:delUserName,
        });
    }
    $("#saveUserOId,#saveUserName,#delUserName,#delUserOId").bind("keydown", function (e) {
        if (e.keyCode == 13) {
            search();
        }
    });

    function bigImg() {
        var row = grid.getSelected();
        if (row) {
            var path = row.saveUserAvatar;
            $("#imgId").attr('src', path);
            $("#outImg").css('display','block');
        }
    }
    function bigImgCode() {
        var row = grid.getSelected();
        if (row) {
            var path = row.delUserAvatar;
            $("#imgId").attr('src', path);
            $("#outImg").css('display','block');
        }
    }
    function smallImg() {
        $("#outImg").css('display','none');
    }


    function onBirthdayRenderer(e) {
        var value = e.value;
        if (value) return mini.formatDate(value, 'yyyy-MM-dd hh:mm:ss');
        return "";
    };

</script>
</html>